The formal syntax of MetaHDL is described using Backus-Naur Form (BNF). 
The conventions used are:
\begin{itemize}
\item Keywords are in lower case \textcolor{red}{red} text.
\item Punctuation are in \textcolor{red}{red} text.
\item A vertical bar ``$|$'' separates alternatives. 
\item UPPER case \textcolor{red}{red} text are tokens from lexer.
\end{itemize}
\rule{130mm}{1pt}\\[1cm]

%% \parbox{130mm}{
%% NOTE: UPPER case texts in \textcolor{red}{red} are tokens from lexer; 
%% lower case texts in \textcolor{red}{red} are keywords; 
%% punctuations are also in \textcolor{red}{red};
%% other texts are non-terminals.}\\

\begin{small}
  \input{BNF.tex}
\end{small}

